/**
 * 
 */
package f.h.dragon.util;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

/**
 * EmptySet: empty set
 *
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012/06/20
 * @since 1.0
 */
public class EmptySet<E> implements Set<E> {

	// Query Operations
	/**
     * Returns the number of elements in this set (its cardinality).  If this
     * set contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
     * <tt>Integer.MAX_VALUE</tt>.
     *
     * @return the number of elements in this set (its cardinality)
     */
	@Override
	public int size() {
		return 0;
	}

	/**
     * Returns <tt>true</tt> if this set contains no elements.
     *
     * @return <tt>true</tt> if this set contains no elements
     */
	@Override
	public boolean isEmpty() {
		return false;
	}

	/**
     * Returns <tt>true</tt> if this set contains the specified element.
     * More formally, returns <tt>true</tt> if and only if this set
     * contains an element <tt>e</tt> such that
     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
     *
     * @param o element whose presence in this set is to be tested
     * @return <tt>true</tt> if this set contains the specified element
     * @throws ClassCastException if the type of the specified element
     *         is incompatible with this set (optional)
     * @throws NullPointerException if the specified element is null and this
     *         set does not permit null elements (optional)
     */
	@Override
	public boolean contains(Object o) {
		return false;
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public Iterator<E> iterator() {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public Object[] toArray() {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public <T> T[] toArray(T[] a) {
		throw new UnsupportedOperationException();
	}

	// Modification Operations
	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean add(E e) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean remove(Object o) {
		throw new UnsupportedOperationException();
	}
	
	// Bulk Operations
	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean containsAll(Collection<?> c) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean addAll(Collection<? extends E> c) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean retainAll(Collection<?> c) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public boolean removeAll(Collection<?> c) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Thrown to indicate that the requested operation is not supported.
	 */
	@Override
	public void clear() {
		throw new UnsupportedOperationException();
	}

}
